package org.apache.flink.runtime.allocatedeploy;

import java.util.List;

import org.apache.flink.runtime.allocatedeploy.execution.Execution;
import org.apache.flink.runtime.allocatedeploy.execution.ExecutionID;

/** Component responsible for assigning slots to a collection of {@link BusinessExecution}. */
/**
 * @类名: ExecutionSlotAllocator
 * @说明: Execution资源slot神清器
 *
 * @author   leehom
 * @Date	 2024年7月27日 下午11:03:20
 * 修改记录：
 *
 * @see 	 
 */
public interface ExecutionSlotAllocator {

    /**
     * Allocate slots for the given executions.
     *
     * @param executionAttemptIds executions to allocate slots for
     * @return List of slot assignments to the executions
     */
    List<ExecutionSlotAssignment> allocateSlotsFor(List<ExecutionID> executionAttemptIds);

    /**
     * Cancel the ongoing slot request of the given {@link BusinessExecution}.
     *
     * @param executionAttemptId identifying the {@link BusinessExecution} of which the slot request should
     *     be canceled.
     */
    void cancel(ExecutionID executionAttemptId);
}
